package com.fiveGroup.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fiveGroup.mapper.ProductReviewMapper;
import com.fiveGroup.pojo.ProductReview;
import com.fiveGroup.pojo.vo.ProductReviewVo;
import com.fiveGroup.service.ProductReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 86188
 * @description 针对表【product_review(商品评价表)】的数据库操作Service实现
 * @createDate 2025-09-26 15:01:12
 */
@Service
public class ProductReviewServiceImpl extends ServiceImpl<ProductReviewMapper, ProductReview>
        implements ProductReviewService {

    @Autowired
    ProductReviewMapper productReviewMapper;

    @Override
    public List<ProductReviewVo> selectByProductId(Long productId) {
        return productReviewMapper.selectByProductId(productId);
    }

    @Override
    public int deleteReview(Long reviewId) {
        return productReviewMapper.deleteReview(reviewId);
    }

    @Override
    public int addReview(ProductReview productReview) {
        return productReviewMapper.addReview(productReview);
    }
}




